<template>
  <div>
    <el-button :icon="Edit" link type="primary" @click="EditHandle(row)" />
    <slot :row="row" name="middleOperationButton"></slot>
    <el-button :icon="Delete" link type="danger" @click="DeleteHandle(row)" />
  </div>
</template>

<script setup lang="ts">
import { Delete, Edit } from '@element-plus/icons-vue';

defineProps<{
  row: any;
}>();

const emit = defineEmits<{
  (e: 'delete', row: any): void;
  (e: 'edit', row: any): void;
}>();

const EditHandle = (row: any) => {
  emit('edit', row);
};

const DeleteHandle = (row: any) => {
  emit('delete', row);
};
</script>
